from django.db import models
import uuid
# Create your models here.

class Org(models.Model):
    id=models.AutoField(primary_key=True)
    name=models.CharField(max_length=50,unique=True,verbose_name='组织名称')
    choices=(
        (1,'开发'),
        (2,'运维'),
        (3,'产品'),
        (4,'测试')
    )
    org_type=models.IntegerField(choices=choices,verbose_name='职位')
    def __str__(self):
        return self.name+':'+str(self.org_type)

class User(models.Model):
    id = models.UUIDField(primary_key=True, auto_created=True,default=uuid.uuid4, editable=False,verbose_name='UUID')
    name=models.CharField(max_length=20,null=False,verbose_name='姓名')
    empno=models.BigIntegerField(max_length=50,unique=True,null=False,verbose_name='员工编号')
    group=models.ManyToManyField(Org)
    def __str__(self):
        return self.name


